﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace PRE.Register
{
    public partial class FrmDSHocvienDK : DevExpress.XtraEditors.XtraForm
    {
        DAL.EntitesDAL.LophocDAL _dal = new DAL.EntitesDAL.LophocDAL();
        DAL.EntitesDAL.KhoahocDAL _dal1 = new DAL.EntitesDAL.KhoahocDAL();
        DAL.EntitesDAL.HocvienDAL _dal2 = new DAL.EntitesDAL.HocvienDAL();
        public string _malop;

        public FrmDSHocvienDK()
        {
            InitializeComponent();
        }

        private void FrmDSHocvienDK_Load(object sender, EventArgs e)
        {
            DataTable tmp = _dal1.Select_Current(DateTime.Now);
            DataTable dtb = _dal.Select(tmp.Rows[0]["Makhoa"] + "");
            if (dtb != null)
                cboLophoc.Properties.DataSource = dtb;

            cboLophoc.EditValue = _malop;
        }

        private void cboLophoc_EditValueChanged(object sender, EventArgs e)
        {
            string malop = cboLophoc.EditValue + "";
            DataTable dtb = _dal2.Select_DSDangky(malop);
            if (dtb != null)
                grcMain.DataSource = dtb;
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            this.Close();
        }

    }
}